using System;
using System.Collections.Generic;
using System.Text;

namespace GoogleTranslator
{
	public class Language
	{
		#region Instancias de Langauge
		public static Language AFRIKAANS = new Language("AFRIKAANS", "af");
		public static Language ALBANIAN = new Language("ALBANIAN", "sq");
		public static Language AMHARIC = new Language("AMHARIC", "am");
		public static Language ARABIC  = new Language("ARABIC", "ar");
		public static Language ARMENIAN = new Language("ARMENIAN", "hy");
		public static Language AZERBAIJANI = new Language("AZERBAIJAN", "az");
		public static Language BASQUE = new Language("BASQUE", "eu");
		public static Language BELARUSIAN = new Language("BELARUSIAN", "be");
		public static Language BENGALI = new Language("BENGALI", "bn");
		public static Language BIHARI = new Language("BIHARI", "bh");
		public static Language BRETON = new Language("BRETON", "br");
		public static Language BULGARIAN = new Language("BULGARIAN", "bg");
		public static Language BURMESE = new Language("BURMESE", "my");
		public static Language CATALAN = new Language("CATALAN", "ca");
		public static Language CHEROKEE = new Language("CHEROKEE", "chr");
		public static Language CHINESE = new Language("CHINESE", "zh");
		public static Language CHINESE_SIMPLIFIED  = new Language("CHINESE_SIMPLIFIED", "zh-CN");
		public static Language CHINESE_TRADITIONAL = new Language("CHINESE_TRADITIONAL", "zh-TW");
		public static Language CORSICAN = new Language("CORSICAN", "co");
		public static Language CROATIAN = new Language("CROATIAN", "hr");
		public static Language CZECH = new Language("CZECH", "cs");
		public static Language DANISH = new Language("DANISH", "da");
		public static Language DHIVEHI = new Language("DHIVEHI", "dv");
		public static Language DUTCH = new Language("DUTCH", "nl");
		public static Language ENGLISH = new Language("ENGLISH", "en");
		public static Language ESPERANTO = new Language("ESPERANTO", "eo");
		public static Language ESTONIAN = new Language("ESTONIAN", "et");
		public static Language FAROESE = new Language("FAROESE", "fo");
		public static Language FILIPINO = new Language("FILIPINO", "tl");
		public static Language FINNISH = new Language("FINNISH", "fi");
		public static Language FRENCH  = new Language("FRENCH", "fr");
		public static Language FRISIAN  = new Language("FRISIAN", "fy");
		public static Language GALICIAN  = new Language("GALICIAN", "gl");
		public static Language GEORGIAN  = new Language("GEORGIAN", "ka");
		public static Language GERMAN  = new Language("GERMAN", "de");
		public static Language GREEK  = new Language("GREEK", "el");
		public static Language GUJARATI = new Language("GUJARATI", "gu");
		public static Language HAITIAN_CREOLE = new Language("HAITIAN_CREOLE", "ht");
		public static Language HEBREW = new Language("HEBREW", "iw");
		public static Language HINDI = new Language("HINDI", "hi");
		public static Language HUNGARIAN = new Language("HUNGARIAN", "hu");
		public static Language ICELANDIC = new Language("ICELANDIC", "is");
		public static Language INDONESIAN = new Language("INDONESIAN", "id");
		public static Language INUKTITUT = new Language("INUKTITUT", "iu");
		public static Language IRISH  = new Language("IRISH", "ga");
		public static Language ITALIAN  = new Language("ITALIAN", "it");
		public static Language JAPANESE= new Language("JAPANESE", "ja");
		public static Language JAVANESE  = new Language("JAVANESE", "jw");
		public static Language KANNADA = new Language("KANNADA", "kn");
		public static Language KAZAKH = new Language("KAZAKH", "kk"); 
		public static Language KHMER = new Language("KHMER", "km"); 
		public static Language KOREAN = new Language("KOREAN", "ko"); 
		public static Language KURDISH = new Language("KURDISH", "ku");
		public static Language KYRGYZ = new Language("KYRGYZ", "ky"); 
		public static Language LAO = new Language("LAO", "lo");
		public static Language LATIN = new Language("LATIN", "la");
		public static Language LATVIAN  = new Language("LATVIAN", "lv");
		public static Language LITHUANIAN  = new Language("LITHUANIAN", "lt");
		public static Language LUXEMBOURGISH  = new Language("LUXEMBURGISH", "lb");
		public static Language MACEDONIAN = new Language("MACEDONIAN", "mk");
		public static Language MALAY = new Language("MALAY", "ms");
		public static Language MALAYALAM = new Language("MALAYALAM", "ml");
		public static Language MALTESE= new Language("MALTESE", "mt");
		public static Language MAORI  = new Language("MAORI", "mi") ;
		public static Language MARATHI = new Language("MARATHI", "mr");
		public static Language MONGOLIAN  = new Language("MONGOLIAN", "mn");
		public static Language NEPALI= new Language("NEPALI", "ne") ;
		public static Language NORWEGIAN = new Language("NORWEGIAN", "no") ;
		public static Language OCCITAN  = new Language("OCCITAN", "oc");
		public static Language ORIYA  = new Language("ORIYA", "or");
		public static Language PASHTO  = new Language("PASHTO", "ps") ;
		public static Language PERSIAN = new Language("PERSIAN", "fa");
		public static Language POLISH= new Language("POLISH", "pl");
		public static Language PORTUGUESE  = new Language("PORTUGUESE", "pt");
		public static Language PORTUGUESE_PORTUGAL = new Language("PORTUGUESE_PORTUGAL", "pt-PT");
		public static Language PUNJABI = new Language("PUNJABI", "pa");
		public static Language QUECHUA  = new Language("QUECHUA", "qu");
		public static Language ROMANIAN = new Language("ROMANIAN", "ro");
		public static Language RUSSIAN  = new Language("RUSSIAN", "ru");
		public static Language SANSKRIT  = new Language("SANSKRIT", "sa");
		public static Language SCOTS_GAELIC = new Language("SCOTS_GAELIC", "gd");
		public static Language SERBIAN = new Language("SERBIAN", "sr");
		public static Language SINDHI = new Language("SINDHI", "sd");
		public static Language SINHALESE = new Language("SINHALESE", "si") ;
		public static Language SLOVAK = new Language("SLOVAK", "sk");
		public static Language SLOVENIAN = new Language("SLOVENIAN", "sl");
		public static Language SPANISH  = new Language("SPANISH", "es");
		public static Language SUNDANESE = new Language("SUNDANESE", "su") ;
		public static Language SWAHILI = new Language("SWAHILI", "sw");
		public static Language SWEDISH = new Language("SWEDISH", "");
		public static Language SYRIAC = new Language("SYRIAC", "syr") ;
		public static Language TAJIK = new Language("TAJIK", "tg");
		public static Language TAMIL  = new Language("TAMIL", "ta");
		public static Language TATAR = new Language("TATAR", "tt");
		public static Language TELUGU  = new Language("TELUGU", "te");
		public static Language THAI  = new Language("THAI", "th") ;
		public static Language TIBETAN  = new Language("TIBETAN", "bo") ;
		public static Language TONGA = new Language("TONGA", "to");
		public static Language TURKISH = new Language("TURKISH", "tr");
		public static Language UKRAINIAN  = new Language("UKRAINIAN", "uk");
		public static Language URDU  = new Language("URDU", "ur");
		public static Language UZBEK  = new Language("UZBEK", "uz") ;
		public static Language UIGHUR  = new Language("UIGHUR", "ug");
		public static Language VIETNAMESE = new Language("VIETNAMESE", "vi");
		public static Language WELSH = new Language("WELSH", "cy");
		public static Language YIDDISH  = new Language("YIDDISH", "yi");
		public static Language YORUBA = new Language("YORUBA", "yo");
		#endregion

		public static List<Language> Languages {
			get { return _Languages; }
		}

		public string LanguageCode {
			get { return _LanguageCode; }
		}

		public string LanguageName {
			get { return _LanguageName; }
		}

		public static Language FindLanguage(string languageName) {
			Language result = null;
			foreach (Language l in _Languages) {
				if (l.LanguageName.ToLower().Equals(languageName.ToLower())) {
					result = l;
					break;
				}
			}
			return result;
		}

		public static Language FindLanguageByCode(string languageCode) {
			Language result = null;
			foreach (Language l in _Languages) {
				if (l.LanguageCode.Equals(languageCode)) {
					result = l;
					break;
				}
			}
			return result;
		}

		#region Ambito privado

		private Language(string languageName, string languageCode) {
			_LanguageCode = languageCode;
			_LanguageName = languageName;
			if (_Languages == null) _Languages = new List<Language>();
			_Languages.Add(this);
		}

		private static List<Language> _Languages;
		
		private string _LanguageCode;
		private string _LanguageName;
		#endregion
	}
}
